﻿using System;
using System.Web.UI.WebControls;
using BLL.RF.SourceCategory;

public partial class ViewbyProduct_ViewRFSourceData_ViewNFCheckItem_ID : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindNFCheckItem();
        }
    }

    private void BindNFCheckItem()
    {
        NFCheckItem testItem = new NFCheckItem();
        if (Request.QueryString["ID"] != null)
        {
            int id = int.Parse(Request.QueryString["ID"].ToString());
            GridView1.DataSource = testItem.NFCheckItem_GetbyID(id);
            GridView1.DataBind();
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (GridView1.Rows[i].Cells[4].Text == "Fail")
                    GridView1.Rows[i].Cells[4].ForeColor = System.Drawing.Color.Red;
            }
        }
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindNFCheckItem();
    }
}
